<%@page import="com.tubeilike.entity.Tube"%>
<%@page import="com.tubeilike.entity.TubesFeed"%>
<%@page import="java.util.*"%>

<%	
	request.setCharacterEncoding("UTF-8");
	String type = "search";
	String searchKey = request.getAttribute("key").toString();
	String url = request.getAttribute("url").toString();	;
	String title = searchKey +  " - TubeOnFire";
	String description = "Mix something from youtube. Create an video playlist in seconds";
	String keyword = searchKey + ", video clip, youtube, mix clip, tubeonfire.com, tubeonfire, your clip...";
%>
<jsp:include page="/element/header.jsp">	
	<jsp:param name="url" value="<%= url %>"/>
	<jsp:param name="title" value="<%=title %>"/>	
	<jsp:param name="keywords" value="<%=keyword %>"/>
	<jsp:param name="description" value="<%=description %>"/>
</jsp:include>
<div class="clear"></div>    
<section id="wrapper">		
	<div class="column-full">
	<br />
        <div class="pager-description">
            <p class="title"><%=searchKey%></p>
            <span class="accent-line goright"></span>                               
        </div>	
		<jsp:include page="/element/advertising_top01.jsp"/>			
		<div class="page_wrap">
		<div class="page_container box_alignleft sidebox">
		<div class="viboxes">
			<ul id="sortable1">
<%
	TubesFeed result = (TubesFeed)request.getAttribute("result");
	if(result!=null&&result.getListTube().size()>0){
	int i = 1;
	for(Tube tub: result.getListTube()){
	if((i%3)!=0){
%>
				<li style="margin-right:30px; margin-bottom:18px;" id="<%=tub.getTubeId()%>" class='dragtrue'>
				<%
			}else{
				%>
				<li style="margin-right:30px; margin-bottom:18px;"  class="last" id="<%=tub.getTubeId()%>" class='dragtrue'>
				<%
			}
		%>		
		      	<div class="content" style="width:200px;" title="<%=tub.getTitle().getValue()%>" >
					  <div class="preview" style="height:125px;">
						  <div class="picture">
						  <div class="alpha">
						  	<a href="/video/<%=tub.getTubeId() %>/<%=tub.getAlias().getValue() %>.html" title="<%=tub.getTitle().getValue()%>">
						  		<img src="<%=tub.getThumbImageUrl().getValue() %>" alt="<%=tub.getTitle().getValue()%>" width="200" height="125"/>
					  		</a>
				  		  </div>
				  		  <div class="date">
					  		  	<a class="button red small icon clock" href="/video/<%=tub.getTubeId() %>/<%=tub.getAlias().getValue() %>.html" ><%=tub.getTotalTime().getValue() %></a>
					  		  	<a class="button red small icon refresh repeat" href="https://www.youtube.com/watch?v=<%=tub.getTubeId()%>">Repeat &nbsp;</a>
			  		  	  </div>
			  		  	  </div>
		  		  	  </div>
					  <div class="title">
					  		<a href="/video/<%=tub.getTubeId() %>/<%=tub.getAlias().getValue() %>.html" title="<%=tub.getTitle().getValue() %>"><%=tub.getSubTitle() %></a>
				  	  </div>
				</div>
				</li>
		<%
		i++;
	}
	}
%>
			</ul>
			
<div class="clear"></div>
<jsp:include page="/element/paginator.jsp">	
	<jsp:param name="currentPage" value="<%= result.getCurrentPage() %>"/>
	<jsp:param name="totalResult" value="<%= result.getTotalResult() %>"/>
	<jsp:param name="searchKey" value="<%= searchKey %>"/>
	<jsp:param name="type" value="<%= type %>"/>
</jsp:include>
<br />
<br />
<br />
</div>
</div>
<div class="page_sidebox box_alignfull">

<jsp:include page="/element/playlist.jsp"/>

<!-- end pv-sidebox --></div>
</div>
<div class="clear"></div>

<jsp:include page="/element/advertising_right02.jsp"/>	
<jsp:include page="/element/footer.jsp"/>	
